<!DOCTYPE html>
<script type="text/javascript" src="ucsv-1.0.2_mod_tab.js"></script>
<span id="ajaxButton" style="cursor: pointer; text-decoration: underline">
  Make a request
</span>
<script type="text/javascript">
(function() {
  var httpReq;
  document.getElementById("ajaxButton").onclick = function() { makeRequest('test.html'); };

  function makeRequest(url) {
    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
      httpReq = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
      try {
        httpReq = new ActiveXObject("Msxml2.XMLHTTP");
      } 
      catch (e) {
        try {
          httpReq = new ActiveXObject("Microsoft.XMLHTTP");
        } 
        catch (e) {}
      }
    }

    if (!httpReq) {
      alert('Giving up :( Cannot create an XMLHTTP instance');
      return false;
    }
    httpReq.onreadystatechange = alertContents;
    httpReq.open('GET', url);
    httpReq.send();
  }

  function alertContents() {
    if (httpReq.readyState == 4) {
      if (httpReq.status == 200) {
        alert(httpReq.responseText);
    } else {
      alert('There was a problem with the request.');
    }
  }
}
)();
</script>
